<jsp:directive.include file="/WEB-INF/sitemesh-decorators/include.jsp" />
<%@ page language="java" isELIgnored="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!-- DropdownChecklist -->
<%-- <link href="${pageContext.request.contextPath}/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" /> --%>
<link href="${pageContext.request.contextPath}/css/datepicker/jquery-ui-1.8.21.custom-redmond.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-ui-1.8.16.custom.min.js"></script>

<link href="${pageContext.request.contextPath}/css/ui.dropdownchecklist.themeroller.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/ui.dropdownchecklist-1.4-min.js"></script>
<!-- End dropdownChecklist -->

<script>
function confirmSaveChange(delUrl) {
  if (confirm("You haven't finished your update yet.\nDo you want to leave without finishing?")) {
    document.location = delUrl;
  }
}
</script>

<!-- CK editor for more option -->
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/jquery.tinymce.js"></script>
<script type="text/javascript">
   Wicket.Event.add(window,"domready",function(event) {
      $('#description').tinymce({
            script_url : '${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce.js',
            theme : "advanced",
            auto_resize : "true",
            relative_urls : false,
            verify_html : false,
            width : "99%",
            height: '200',
            plugins : "safari,style,layer,emotions,iespell,paste,xhtmlxtras",
            theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,paste,pastetext,pasteword,|,bullist,numlist,|,emotions",
            theme_advanced_buttons2 : "",
            theme_advanced_buttons3 : "",
            theme_advanced_buttons4 : "",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_resizing : false
      });
   });
</script>
<!-- End CK editor for more option -->

<div class="cubeTitleWrapper">
      <span class="cube_title">SharedWorkspaces</span> <span class="wklinks"> <span class="settings"><a
            href="">Settings</a></span>
      </span>
</div>

<div class="cube">
	<div>
		<div class="cube">
			<div class="innertube innertube_form EditPostingPanel full">
				<div>
					<h2 class="userDefinedBg">
						<span class="right_end"><span class="start"><span>Edit</span></span></span>
					</h2>
				</div>
				<div class="contentBlock">
					<span id="feedbackPanel"> </span>
					
					<form id="form" method="post" action="${pageContext.request.contextPath}/topic/${topic.id}/update">
						<div
							style="width: 0px; height: 0px; position: absolute; left: -100px; top: -100px; overflow: hidden">
							<input name="form_hf_0" id="form_hf_0" type="hidden">
						</div>
						<span style="font-size: 14px; font-weight: bold;">Title</span> 
						<input	class="Text semiFull" value="${topic.title }" name="title" type="text" autofocus="autofocus"><br>
						<br>
						<div id="optionListContainer141" style="display:none"></div>
						<span style="font-size: 14px; font-weight: bold;">Description (optional)</span>
						
						<textarea style="width: 98%; height: 180px;  " name="description" id="description"  COLS=40 ROWS=6 >${topic.content }</textarea>
						
						<a style="color: rgb(72, 157, 212);" class="gcSubmit" id="commentSubmitAjax" onclick="var e=document.getElementById('form'); e.name='submitLink'; e.value='uploadNewVersion';var f=document.getElementById('form');var ff=f;if (ff.onsubmit != undefined) { if (ff.onsubmit()==false) return false; }f.submit();e.value='';e.name='';return false;">
							Update
							<span class="left"></span>
							<span class="right"></span>
						</a>
						<span>or</span>
						<a style="font-size:15px; color:rgb(72, 157, 212);" href="javascript:confirmSaveChange('${pageContext.request.contextPath}/topic/${topic.id}/view')">cancel</a>
						<img id="imgAddComment" style="display: none;"  src="${pageContext.request.contextPath}/images/throbber.gif">	
						<span style="margin-top:10px;top:-3px;">&nbsp;&nbsp;&nbsp;Notify by email</span>
						
						<!-- Insert drop down list check -->
						<span style="padding-top:7px;">
							<script type="text/javascript">
						        $(document).ready(function() {
						            
						            $("#s89").dropdownchecklist( { firstItemChecksAll: true, emptyText: "Select...", width: 150 } );
						            	
						        });
						    </script>	  		
					        <select id="s89" class="s8" multiple="multiple" style="font-size: 7px;">
					        
					        	<option value="0">All</option>
					            <c:forEach items="${userlists }" var="user">
					            	<option value="${user.id }">${user.username }</option>
					            </c:forEach>
					            
					        </select>
							
						</span>
						<div class="spacer"></div>
					</form>
					<div class="spacer"></div>
				</div>
				<div class="contentBlock_bottom">
					<span class="right_end"><span></span></span>
				</div>
			</div>
		</div>
	</div>
</div>

